/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package group2assignone.ucm.manager;

import group2assignone.dao.MyDAO;
import group2assignone.model.Airport;
import group2assignone.ucm.UCController;
import group2assignone.ucm.UCStartup;
import group2assignone.view.manager.EditAirportView;
import group2assignone.view.manager.ManagerView;

/**
 *
 * @author Natalie
 */
public class UCEditAirportDone implements UCController
{
    private EditAirportView view;

    public UCEditAirportDone(EditAirportView view)
    {
        this.view = view;
    }

    public void run()
    {
        Airport airport = new Airport();
        view.loadDetails(airport);
        String oldAirportLoc = view.getOldAirportLoc();

        MyDAO coms = UCStartup.getInstance().getDAO();
        coms.sQLEditAirport(airport, oldAirportLoc);

        view.dispose();
        ManagerView manView = ManagerView.getInstance();
        manView.go();

    }
}
